package Libray;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xwl
 * Date: 2023-04-16
 * Time: 0:34
 */
public class Book {
    // 书名
    String bookName;
    // 书的作者
    String author;
    // 书的入库时间
    int year;
    int month;
    int day;
    // 书的状态
    boolean bookFlag;
    //

    public Book(String bookName, String author, int year, int month, int day, boolean bookFlag) {
        this.bookName = bookName;
        this.author = author;
        this.year = year;
        this.month = month;
        this.day = day;
        this.bookFlag = bookFlag;
    }

    // get/set
    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public boolean isBookFlag() {
        return bookFlag;
    }

    public void setBookFlag(boolean bookFlag) {
        this.bookFlag = bookFlag;
    }
    // toString
    @Override
    public String toString() {
        return "BookShelf{" +
                "bookName='" + bookName + '\'' +
                ", author='" + author + '\'' +
                ", 状态" + (bookFlag == false ? "未借出" : "已借出") +
                '}';
    }
}
